package com.cn.xiaonuo.slbfinances.slbwallets.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.slbfinances.slbwallets.service.IShopWalletService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(description = "商家钱包接口")
@RestController
@CrossOrigin
public class ShopWalletController {

    @Resource
    private IShopWalletService shopWalletService;
    /**
     * 查询商户钱包列表
     */
    @ApiOperation(value = "商户钱包--查询商户钱包列表", notes = "商户钱包--查询商户钱包列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID（Integer）",example = "10086"),
            @ApiImplicitParam(name = "pageNo", value = "第几页（Integer）", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页长度（Integer）", required = true)
    })
    @PostMapping("/api/shopWallet/queryShopWalletList")
    public BusinessMessage queryShopWalletList(Integer pageNo, Integer pageSize,
                                               Integer userId) {
        return shopWalletService.queryShopWalletList(pageNo, pageSize, userId);
    }

    /**
     * 查询商户余额变化列表
     */
    @ApiOperation(value = "商户钱包--查询商户余额变化列表", notes = "商户钱包--查询商户余额变化列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID（Integer）",example = "10086"),
            @ApiImplicitParam(name = "pageNo", value = "第几页（Integer）", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页长度（Integer）", required = true)
    })
    @PostMapping("/api/shopWallet/queryYEChangeLogList")
    public BusinessMessage queryYEChangeLogList(Integer pageNo, Integer pageSize,
                                                Integer userId) {
        return shopWalletService.queryYEChangeLogList(pageNo, pageSize, userId);
    }
}
